using System.Collections;
using Holoville.HOTween;
using UnityEngine;

public class ButtonMover : MonoBehaviour
{
	public float timeScale;

	public float timeMove;

	public Vector3 EndPosition;

	public UISprite sprite;

	private void Awake()
	{
		sprite.gameObject.SetActive(false);
	}

	public IEnumerator Mover()
	{
		float time = 0f;
		base.transform.position = Vector3.zero;
		sprite.gameObject.SetActive(true);
		do
		{
			yield return null;
			time += Time.deltaTime;
			base.gameObject.transform.localScale = Vector3.one * Mathf.Clamp(time / timeScale, 0f, 1f);
		}
		while (time < timeScale);
		yield return new WaitForSeconds(0.2f);
		HOTween.To(base.transform, timeMove, new TweenParms().Prop("position", EndPosition));
		yield return new WaitForSeconds(timeMove);
		base.gameObject.SetActive(false);
	}
}
